<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="main" style="width: 600px; height: 500px"></div>
  </body>
  <script src="./lib/echarts.min.js"></script>
  <script>
    var chartDom = document.getElementById("main");
    var myChart = echarts.init(chartDom);
    var option;

    option = {
      title: [
        {
          text: "男女薪资分布",
          left: "3%",
          top: "4%",
        },
        {
          text: "男生",
          left: "center",
          top: "45%",
        },
        {
          text: "女生",
          left: "center",
          top: "95%",
        },
      ],
      tooltip: {
        trigger: "item",
      },
      legend: {
        show: false,
        orient: "vertical",
        left: "left",
      },
      grid: {
        show: false,
        left: "100%",
      },
      color: ["#fac03d", "#597eed", "#42bafb", "#3ed3a8"],

      series: [
        {
          name: "Access From",
          type: "pie",
          radius: ["20%", "30%"],
          center: ["50%", "25%"],
          itemStyle: {
            borderColor: "#fff",
          },
          data: [
            { value: 1048, name: "Search Engine" },
            { value: 735, name: "Direct" },
            { value: 580, name: "Email" },
            { value: 484, name: "Union Ads" },
            { value: 300, name: "Video Ads" },
          ],

          emphasis: {
            itemStyle: {
              shadowBlur: 10,
              shadowOffsetX: 0,
              shadowColor: "rgba(0, 0, 0, 0.5)",
            },
          },
        },
        {
          name: "Access From",
          type: "pie",
          radius: ["20%", "30%"],
          center: ["50%", "75%"],
          itemStyle: {
            borderColor: "#fff",
          },
          data: [
            { value: 1048, name: "Search Engine" },
            { value: 735, name: "Direct" },
            { value: 580, name: "Email" },
            { value: 484, name: "Union Ads" },
            { value: 300, name: "Video Ads" },
          ],

          emphasis: {
            itemStyle: {
              shadowBlur: 10,
              shadowOffsetX: 0,
              shadowColor: "rgba(0, 0, 0, 0.5)",
            },
          },
        },
      ],
    };
    option && myChart.setOption(option);
  </script>
</html>
